/*
 * @Author       : ShiJunJie
 * @Date         : 2022-04-26 16:17:02
 * @LastEditors  : ShiJunJie
 * @LastEditTime : 2022-04-26 19:37:42
 * @FilePath     : /src/utils/validationCode.ts
 * @Descripttion : 
 */
const codes = {
  601: () => {
    localStorage.clear()
    setTimeout(() => {
      window.location.reload()
    }, 1500)
    return '非法请求 请重新登录'
  },
  10010023: '密码过期，请重新设置密码'
}

const validationCode = (code: any) => {
  return typeof codes[code] === 'function'
    ? codes[code]()
    : codes[code]
}

export default validationCode
